package com.maduar.demo.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * Description:
 *
 * @author danny.pang danny.pang@ebizprise.com
 * @date 2020-06-06 15:47
 */
//@Component
//@Aspect
//public class AopController {
//
//    @Around("execution(* com.maduar.demo.controller.(..))")
//    public void before(ProceedingJoinPoint joinPoint) {
//
//        try {
//            joinPoint.proceed();
//        } catch (Throwable throwable) {
//            throwable.printStackTrace();
//        }
//    }
//
//
//    //@AfterThrowing: 异常通知
//    @AfterThrowing(value="execution (* *.*(..))",throwing="e")
//    public void afterReturningMethod(JoinPoint joinPoint, Exception e){
//        String methodName = joinPoint.getSignature().getName();
//        System.out.println("The method name:"+methodName+ " ends and result="+e);
//    }
//}
